<script setup lang="ts">
import { useUrlSearchParams } from "@vueuse/core";
import { Input, Button } from "ant-design-vue";
import { ref } from "vue";
const params = useUrlSearchParams("history"); //history模式
// const params = useUrlSearchParams('hash') //hash模式
const queryValue = ref();

const handleSet = () => {
  params.queryName = queryValue.value;
};
const handleReSet = () => {
  delete params.queryName;
};
</script>
<template>
  <Input v-model:value="queryValue" />
  <div class="mt-5">
    <Button class="mr-2" type="primary" @click="handleSet">设置参数</Button>
    <Button type="primary" @click="handleReSet">重置</Button>
  </div>
  <div>浏览器参数 {{ params }}</div>
</template>
<style scoped lang="less"></style>
